/*
 * @Author: deng da chao
 * @Date: 2022-05-24 09:12:10
 * @LastEditTime: 2023-10-24 10:33:23
 * @Description: 配置接口
 */
import http from '../../utils/http'


// 获取app直接上传oss的签名
const getSecurityToken = () => {
  return http.get('/member/sysMember/getSecurityToken')
}

// nft-banner列表
/*
首页：nft_home_top
集市页：nft_market
广场：nft_square
商品页：nft_collection_top
*/
const getSysAdvertisementItemList = (data) => {
  return http.get('/sys/sysAdvertisementItem/list', data)
}


//微信回调 api/v1/member/sysMember/getWxChatOpenId
const getWxChatOpenId = (data) => {
  return http.get('/member/sysMember/getWxChatOpenId', data)
}
// 获取验证码
const getCommonSendSms = (data) => {
  return http.get('/common/sendSmsVerify', data)
}
// 登录接口
const postToken = (data) => {
  return http.post('/token', data)
}
// 用户注销
const postTokenLogoff = () => {
  return http.post('/token/logOff')
}


//查看协议
const getProtocol = (data) => {
  return http.get("/marketing/themePageProtocol/getProtocol", data);
}

//文章详情
const getUnit = (data) => {
  return http.get("/marketing/themePage/getUnit", data);
}

//文章详情
const getThemePageProtocolText = (data) => {
  return http.get("/marketing/themePageProtocol/text/" + data.id, data);
}



// 配置微信分享
const wechatConfigApi = (data) => {
  return http.get('/member/sysMember/getSecurityToken', data)
}

// 获取最新版本
const getSysApkVersion = (data) => {
  return http.get('/sys/sysApkVersion', data)
}

// 小喇叭接口
const getSysMemberNftTrumpet = (data) => {
  return http.get('/member/sysMemberNft/trumpet', data)
}

/*
*批量获取配置 
*configType 1个人中心 2转卖配置
*/
const getCommonConfigList = (data) => {
  return http.get('/common/commonConfigList', data)
}

// 绑定邀请码
const getMarketingDistribution = (data) => {
  return http.get(`/distribution/manGu/appDistributionInvite/bind`, data)
}

//获取提现支持的方式及充值和提现的开关
const getWithdrawalTypeList = (data) => {
  return http.get(`/member/sysMemberBalance/getWithdrawalTypeList`, data)
}

// 获取个人中心按钮
const getMarketingServeConfig = (data) => {
  return http.get(`/marketing/marketingServeConfig/getServes`, data)
}

// 查询字典
const getSysDictDataDetail = (data) => {
  return http.get(`/sys/sysDictData/detail`, data)
}

// 获取加群配置
const getSysDictJoinGroupLink = (data) => {
  return http.get(`/sys/sysDictData/joinGroupLink`, data)
}


// 获取发货列表页
const getRealProductsDeliverRecord = (data) => {
  return http.get(`/delivery/realProductsDeliverRecord/getList`, data)
}

// 获取一级省列表/ldpre/api/v1/sys/sysRegion/getAllProvince
const getAllProvince = (data) => {
  return http.get(`/sys/sysRegion/getAllProvince`, data)
}

// 获取一级市列表/ldpre/api/v1/sys/sysRegion/getAllChildRegionByParentCode/{cityCode}
const getAllChildRegionByParentCode = (data) => {
  return http.get(`/sys/sysRegion/getAllChildRegionByParentCode/${data.id}`)
}
// 查看物流信息
const getRealProductsDeliverRecordLogisticsDetail = (data) => {
  return http.get(`/delivery/realProductsDeliverRecord/logisticsDetail/${data.id}`, data)
}

// 获取领取订单信息/photo/api/v1/order/orderMain/extractPreInfo
const getRealProductsDeliverdWrittenByOrder = (data) => {
  return http.get(`/order/orderMain/extractPreInfo`, data)
}

//提交订单-创建发货记录/photo/api/v1/order/orderMain/unifiedOrder
const unifiedOrder = (data) => {
  return http.post('/order/orderMain/unifiedOrder', data)
}
//提交订单-创建发货记录
const postSubmitOrderAndCreatDeliverRecord = (data) => {
  return http.post('/delivery/realProductsDeliverRecord/submitOrderAndCreatDeliverRecord', data)
}
//新增地址/ldpre/api/v1/member/sysMemberAddr/create
const sysMemberAddr = (data) => {
  return http.post('/member/sysMemberAddr/create', data)
}
// 会员地址列表/ldpre/api/v1/member/sysMemberAddr/list
const sysMemberAddrList = (data) => {
  return http.get(`/member/sysMemberAddr/list`)
}
//删除会员地址/ldpre/api/v1/member/sysMemberAddr/delete/{id}
const sysMemberAddrDel = (data) => {
  return http.delete(`/member/sysMemberAddr/delete/${data.id}`)
}

// 地址详情/ldpre/api/v1/member/sysMemberAddr/detail/{id}
const sysMemberAddrDetails = (data) => {
  return http.get(`/member/sysMemberAddr/detail/${data.id}`)
}
//修改地址/ldpre/api/v1/member/sysMemberAddr/update
const sysMemberAddrUp = (data) => {
  return http.put('/member/sysMemberAddr/update', data)
}

// 设置默认地址/ldpre/api/v1/member/sysMemberAddr/setDefaultAddr/{id}
const setDefaultAddr = (data) => {
  return http.get(`/member/sysMemberAddr/setDefaultAddr/${data.id}`)
}

// 获取仓库信息
const getSysMemberSourceList = (data) => {
  return http.get(`/member/sysMemberSource/list`, data)
}

// 获取如何获取好友码文章id和跳转地址
const getFriendCodeConfig = (data) => {
  return http.get(`/sys/sysDictData/friendCodeConfig`, data)
}
//获取分享配置
/*
value
1 '商务合作' 2客服中心 3 关注潮狗 4转卖配置 5分享配置 6拉新配置 7推广海报配置 ,示例值(4)
*/
const getCommonConfig= (data) => {
  return http.get(`/common/commonConfig`, data)
}
//获取居民卡配置信息
const getConfigImg = (data) => {
  return http.get(`/member/sysMemberResidentCard/getConfigImg`, data)
}
// 获取最新ip
const getUpdateIPAddress = (data) => {
  return http.get(`/member/sysMember/updateIPAddress`, data)
}




export default {
  getSecurityToken,
  getSysAdvertisementItemList,
  getWxChatOpenId,
  getCommonSendSms,
  postToken,
  postTokenLogoff,
  getProtocol,
  wechatConfigApi,
  getUnit,
  getSysApkVersion,
  getSysMemberNftTrumpet,
  getCommonConfigList,
  getMarketingDistribution,
  getThemePageProtocolText,
  getWithdrawalTypeList,
  getMarketingServeConfig,
  getSysDictDataDetail,
  getSysDictJoinGroupLink,
  getRealProductsDeliverRecord,
  getAllProvince,
  getAllChildRegionByParentCode,
  getRealProductsDeliverRecordLogisticsDetail,
  getRealProductsDeliverdWrittenByOrder,
  postSubmitOrderAndCreatDeliverRecord,
  unifiedOrder,
  sysMemberAddr,
  sysMemberAddrList,
  sysMemberAddrDel,
  sysMemberAddrDetails,
  sysMemberAddrUp,
  setDefaultAddr,
  getSysMemberSourceList,
  getFriendCodeConfig,
  getCommonConfig,
  getConfigImg,
  getUpdateIPAddress,
}
